#pragma once

#include <iostream>
#include <string>
#include <sstream>
#include <map>

#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"

class SDLResources
{
#pragma region Singleton
public:
	static SDLResources* GetInstance()
	{ 
		if(!instance)
		{
			instance = new SDLResources();
		}
		return instance;
	}
	static void Kill()
	{
		delete instance;
		instance = 0;
	}
private:
	static SDLResources* instance;
	SDLResources();
	SDLResources(const SDLResources& e);
	~SDLResources();
	SDLResources& operator=(const SDLResources& e);
#pragma endregion
public:
	SDL_Surface* GetTexture(std::string fileName);
	TTF_Font* GetFont(std::string fileName, int size);
private:
	void LoadImage( std::string fileName);
	void LoadFont( std::string fileName, int size);
	std::map<std::string, SDL_Surface*> mLoadedTextures;
	std::map<std::string, TTF_Font*> mLoadedFonts;
};

